home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / MoreFiles 1.3.1 / MoreFilesExtras.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-16  |  56.0 KB  |  1,601 lines  |  [TEXT/MMCC]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    A collection of useful high-level File Manager routines.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        MoreFilesExtras.h
  9. **
  10. **    Copyright © 1992-1995 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILESEXTRAS__
  23. #define __MOREFILESEXTRAS__
  24.  
  25. #include <Types.h>
  26. #include <Files.h>
  27.  
  28. /*****************************************************************************/
  29.  
  30. /*
  31. **    Macros to get information out of GetVolParmsInfoBuffer
  32. */
  33.  
  34. #define    isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  35. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  36. #define    hasLocalWList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  37. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  38. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  39. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  40. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  41. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  42. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  43. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  44. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  45. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  46. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  47. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  48. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  49. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  50. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  51. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  52. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  53. #define hasPersonalAccessPrivileges(volParms) \
  54.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  55. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  56. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  57. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  58. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  59. #define hasBlankAccessPrivileges(volParms) \
  60.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  61.  
  62. /*****************************************************************************/
  63.  
  64. /*
  65. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  66. **    FSpOpenAware, and FSpOpenRFAware functions.
  67. */
  68.  
  69. enum
  70. {
  71.     dmNone            = 0x0000,
  72.     dmNoneDenyRd    = 0x0010,
  73.     dmNoneDenyWr    = 0x0020,
  74.     dmNoneDenyRdWr    = 0x0030,
  75.     dmRd            = 0x0001,    /* Single writer, multiple readers; the readers */
  76.     dmRdDenyRd        = 0x0011,
  77.     dmRdDenyWr        = 0x0021,    /* Browsing - equivalent to fsRdPerm */
  78.     dmRdDenyRdWr    = 0x0031,
  79.     dmWr            = 0x0002,
  80.     dmWrDenyRd        = 0x0012,
  81.     dmWrDenyWr        = 0x0022,
  82.     dmWrDenyRdWr    = 0x0032,
  83.     dmRdWr            = 0x0003,    /* Shared access - equivalent to fsRdWrShPerm */
  84.     dmRdWrDenyRd    = 0x0013,
  85.     dmRdWrDenyWr    = 0x0023,    /* Single writer, multiple readers; the writer */
  86.     dmRdWrDenyRdWr    = 0x0033    /* Exclusive access - equivalent to fsRdWrPerm */
  87. };
  88.     
  89. /*****************************************************************************/
  90.  
  91. /*
  92. **    For those times where you need to use more than one kind of File Manager parameter
  93. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  94. */
  95.  
  96. #if GENERATINGPOWERPC
  97. #pragma options align=mac68k
  98. #endif
  99. union UniversalFMPB
  100. {
  101.     ParamBlockRec    PB;
  102.     CInfoPBRec        ciPB;
  103.     DTPBRec            dtPB;
  104.     HParamBlockRec    hPB;
  105.     CMovePBRec        cmPB;
  106.     WDPBRec            wdPB;
  107.     FCBPBRec        fcbPB;
  108. };
  109. #if GENERATINGPOWERPC
  110. #pragma options align=reset
  111. #endif
  112.  
  113. typedef union UniversalFMPB UniversalFMPB;
  114. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  115.  
  116.  
  117. /*
  118. **    Used by GetUGEntries to return user or group lists
  119. */
  120.  
  121. #if GENERATINGPOWERPC
  122. #pragma options align=mac68k
  123. #endif
  124. struct UGEntry
  125. {
  126.     short    objType;    /* object type: -1 = group; 0 = user */
  127.     long    objID;        /* the user or group ID */
  128.     Str31    name;        /* the user or group name */
  129. };
  130. #if GENERATINGPOWERPC
  131. #pragma options align=reset
  132. #endif
  133.  
  134. typedef struct UGEntry UGEntry;
  135. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  136.  
  137.  
  138. typedef unsigned char Str8[9];
  139.  
  140.  
  141. /*
  142. **    I use the following record instead of the AFPVolMountInfo structure in Files.h
  143. */
  144.  
  145. #if GENERATINGPOWERPC
  146. #pragma options align=mac68k
  147. #endif
  148. struct MyAFPVolMountInfo
  149. {
  150.     short length;                /* length of this record */
  151.     VolumeType media;            /* type of media, always AppleShareMediaType */
  152.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  153.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  154.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  155.     short uamType;                /* User Authentication Method */
  156.     short zoneNameOffset;        /* offset from start of record to zoneName */
  157.     short serverNameOffset;        /* offset from start of record to serverName */
  158.     short volNameOffset;        /* offset from start of record to volName */
  159.     short userNameOffset;        /* offset from start of record to userName */
  160.     short userPasswordOffset;    /* offset from start of record to userPassword */
  161.     short volPasswordOffset;    /* offset from start of record to volPassword */
  162.     Str31 zoneName;                /* server's AppleTalk zone name */                    
  163.     Str31 serverName;            /* server name */                    
  164.     Str27 volName;                /* volume name */                    
  165.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  166.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  167.     char filler1;                /* to word align volPassword */
  168.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  169.     char filler2;                /* to end record on word boundry */
  170. };
  171. #if GENERATINGPOWERPC
  172. #pragma options align=reset
  173. #endif
  174.  
  175. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  176. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  177.  
  178. /*****************************************************************************/
  179.  
  180. pascal    Ptr    GetTempBuffer(long buffReqSize,
  181.                           long *buffActSize);
  182. /*    ¶ Allocate a temporary copy or search buffer.
  183.     The GetTempBuffer function allocates a temporary buffer for file system
  184.     operations which is at least 1024 bytes (1K) and a multiple of
  185.     1024 bytes.
  186.     
  187.     buffReqSize        input:    Size you'd like the buffer to be.
  188.     buffActSize        output:    Size of buffer allocated.
  189.     function result    output:    Pointer to memory allocated or nil if no memory
  190.                             was available. The caller is responsible for
  191.                             disposing of this buffer with DisposePtr.
  192. */
  193.  
  194. /*****************************************************************************/
  195.  
  196. pascal    OSErr    DetermineVRefNum(StringPtr pathname,
  197.                                  short vRefNum,
  198.                                  short *realVRefNum);
  199. /*    ¶ Determine the real volume reference number.
  200.     The DetermineVRefNum function determines the volume reference number of
  201.     a volume from a pathname, a volume specification, or a combination
  202.     of the two.
  203.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  204.     mounted volumes can have the same name. For this reason, the use of a
  205.     volume name or full pathname to identify a specific volume may not
  206.     produce the results you expect.  If more than one volume has the same
  207.     name and a volume name or full pathname is used, the File Manager
  208.     currently uses the first volume it finds with a matching name in the
  209.     volume queue.
  210.  
  211.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  212.                         partial pathname, it is ignored. A full pathname to a
  213.                         volume must end with a colon character (:).
  214.     vRefNum        input:    Volume specification (volume reference number, working
  215.                         directory number, drive number, or 0).
  216.     realVRefNum    output:    The real volume reference number.
  217. */
  218.  
  219. /*****************************************************************************/
  220.  
  221. pascal    OSErr    HGetVInfo(short volReference,
  222.                           StringPtr volName,
  223.                           short *vRefNum,
  224.                           unsigned long *freeBytes,
  225.                           unsigned long *totalBytes);
  226. /*    ¶ Get information about a mounted volume.
  227.     The HGetVInfo function returns the name, volume reference number,
  228.     available space (in bytes), and total space (in bytes) for the
  229.     specified volume. You can specify the volume by providing its drive
  230.     number, volume reference number, or 0 for the default volume.
  231.     This routine is compatible with volumes up to 4 gigabytes.
  232.     
  233.     volReference    input:    The drive number, volume reference number,
  234.                             or 0 for the default volume.
  235.     volName            input:    A pointer to a buffer (minimum Str27) where
  236.                             the volume name is to be returned or must
  237.                             be nil.
  238.                     output:    The volume name.
  239.     vRefNum            output:    The volume reference number.
  240.     freeBytes        output:    The number of free bytes on the volume.
  241.                             freeBytes is an unsigned long value.
  242.     totalBytes        output:    The total number of bytes on the volume.
  243.                             totalBytes is an unsigned long value.
  244. */
  245.  
  246. /*****************************************************************************/
  247.  
  248. pascal    OSErr    CheckVolLock(StringPtr pathname,
  249.                              short vRefNum);
  250. /*    ¶ Determine if a volume is locked.
  251.     The CheckVolLock function determines if a volume is locked - either by
  252.     hardware or by software. If CheckVolLock returns noErr, then the volume
  253.     is not locked.
  254.  
  255.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  256.                         partial pathname, it is ignored. A full pathname to a
  257.                         volume must end with a colon character (:).
  258.     vRefNum        input:    Volume specification (volume reference number, working
  259.                         directory number, drive number, or 0).
  260. */
  261.  
  262. /*****************************************************************************/
  263.  
  264. pascal    OSErr GetDriverName(short driverRefNum,
  265.                             Str255 driverName);
  266. /*    ¶ Get a device driver's name.
  267.     The GetDriverName function returns a device driver's name.
  268.  
  269.     driverRefNum    input:    The driver reference number.
  270.     driverName        output:    The driver's name.
  271. */
  272.  
  273. /*****************************************************************************/
  274.  
  275. pascal    OSErr    FindDrive(StringPtr pathname,
  276.                           short vRefNum,
  277.                           DrvQElPtr *driveQElementPtr);
  278. /*    ¶ Find a volume's drive queue element in the drive queue.
  279.     The FindDrive function returns a pointer to a mounted volume's
  280.     drive queue element.
  281.  
  282.     pathName            input:    Pointer to a full pathname or nil. If you
  283.                                 pass in a partial pathname, it is ignored.
  284.                                 A full pathname to a volume must end with
  285.                                 a colon character (:).
  286.     vRefNum                input:    Volume specification (volume reference
  287.                                 number, working directory number, drive
  288.                                 number, or 0).
  289.     driveQElementPtr    output:    Pointer to a volume's drive queue element
  290.                                 in the drive queue. DO NOT change the
  291.                                 DrvQEl.
  292. */
  293.  
  294. /*****************************************************************************/
  295.  
  296. pascal    OSErr    GetDiskBlocks(StringPtr pathname,
  297.                               short vRefNum,
  298.                               unsigned long *numBlocks);
  299. /*    ¶ Return the number of physical disk blocks on a disk drive.
  300.     The GetDiskBlocks function returns the number of physical disk
  301.     blocks on a disk drive. NOTE: This is not the same as volume
  302.     allocation blocks!
  303.  
  304.     pathName    input:    Pointer to a full pathname or nil. If you
  305.                         pass in a partial pathname, it is ignored.
  306.                         A full pathname to a volume must end with
  307.                         a colon character (:).
  308.     vRefNum        input:    Volume specification (volume reference
  309.                         number, working directory number, drive
  310.                         number, or 0).
  311.     numBlocks    output:    The number of physical disk blocks on the disk drive.
  312. */
  313.  
  314. /*****************************************************************************/
  315.  
  316. pascal    OSErr    UnmountAndEject(StringPtr pathname,
  317.                                 short vRefNum);
  318. /*    ¶ Unmount and eject a volume.
  319.     The UnmountAndEject function unmounts and ejects a volume. The volume
  320.     is ejected only if it is ejectable and not already ejected.
  321.     
  322.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  323.                         partial pathname, it is ignored. A full pathname to a
  324.                         volume must end with a colon character (:).
  325.     vRefNum        input:    Volume specification (volume reference number, working
  326.                         directory number, drive number, or 0).
  327. */
  328.  
  329. /*****************************************************************************/
  330.  
  331. pascal    OSErr    OnLine(FSSpecPtr volumes,
  332.                        short reqVolCount,
  333.                        short *actVolCount,
  334.                        short *volIndex);
  335. /*    ¶ Return the list of volumes currently mounted.
  336.     The OnLine function returns the list of volumes currently mounted in
  337.     an array of FSSpec records.
  338.  
  339.     volumes        input:    Pointer to array of FSSpec where the volume list
  340.                         is returned.
  341.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  342.                         elements in the volumes array).
  343.     actVolCount    output: The number of volumes actually returned.
  344.     volIndex    input:    The current volume index position. Set to 1 to
  345.                         start with the first volume.
  346.                 output:    The volume index position to get the next volume.
  347.                         Pass this value the next time you call OnLine to
  348.                         start where you left off.
  349. */
  350.  
  351. /*****************************************************************************/
  352.  
  353. pascal    OSErr GetDInfo(short vRefNum,
  354.                        long dirID,
  355.                        StringPtr name,
  356.                        DInfo *fndrInfo);
  357. /*    ¶ Get the finder information for a directory.
  358.     The GetDInfo function gets the finder information for a directory.
  359.  
  360.     vRefNum            input:    Volume specification.
  361.     dirID            input:    Directory ID.
  362.     name            input:    Pointer to object name, or nil when dirID
  363.                             specifies a directory that's the object.
  364.     fndrInfo        output:    If the object is a directory, then its DInfo.
  365.  
  366.     __________
  367.     
  368.     Also see:    FSpGetDInfo,
  369. */
  370.  
  371. /*****************************************************************************/
  372.  
  373. pascal    OSErr FSpGetDInfo(const FSSpec *spec,
  374.                           DInfo *fndrInfo);
  375. /*    ¶ Get the finder information for a directory.
  376.     The FSpGetDInfo function gets the finder information for a directory.
  377.  
  378.     spec        input:    An FSSpec record specifying the directory.
  379.     fndrInfo    output:    If the object is a directory, then its DInfo.
  380.  
  381.     __________
  382.     
  383.     Also see:    FSpGetFInfoCompat, GetDInfo
  384. */
  385.  
  386. /*****************************************************************************/
  387.  
  388. pascal    OSErr SetDInfo(short vRefNum,
  389.                        long dirID,
  390.                        StringPtr name,
  391.                        const DInfo *fndrInfo);
  392. /*    ¶ Set the finder information for a directory.
  393.     The SetDInfo function sets the finder information for a directory.
  394.  
  395.     vRefNum            input:    Volume specification.
  396.     dirID            input:    Directory ID.
  397.     name            input:    Pointer to object name, or nil when dirID
  398.                             specifies a directory that's the object.
  399.     fndrInfo        input:    The DInfo.
  400.  
  401.     __________
  402.     
  403.     Also see:    FSpSetDInfo,
  404. */
  405.  
  406. /*****************************************************************************/
  407.  
  408. pascal    OSErr FSpSetDInfo(const FSSpec *spec,
  409.                           const DInfo *fndrInfo);
  410. /*    ¶ Set the finder information for a directory.
  411.     The FSpSetDInfo function sets the finder information for a directory.
  412.  
  413.     spec        input:    An FSSpec record specifying the directory.
  414.     fndrInfo    input:    The DInfo.
  415.  
  416.     __________
  417.     
  418.     Also see:    FSpSetFInfoCompat, SetDInfo
  419. */
  420.  
  421. /*****************************************************************************/
  422.  
  423. pascal    OSErr    GetDirID(short vRefNum,
  424.                          long dirID,
  425.                          StringPtr name,
  426.                          long *theDirID,
  427.                          Boolean *isDirectory);
  428. /*    ¶ Get the directory ID number of the directory specified.
  429.     The GetDirID function gets the directory ID number of the directory
  430.     specified.  If a file is specified, then the parent
  431.     directory of the file is returned and isDirectory is false.  If
  432.     a directory is specified, then that directory's ID number is
  433.     returned and isDirectory is true.
  434.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  435.     mounted volumes can have the same name. For this reason, the use of a
  436.     volume name or full pathname to identify a specific volume may not
  437.     produce the results you expect.  If more than one volume has the same
  438.     name and a volume name or full pathname is used, the File Manager
  439.     currently uses the first volume it finds with a matching name in the
  440.     volume queue.
  441.     
  442.     vRefNum            input:    Volume specification.
  443.     dirID            input:    Directory ID.
  444.     name            input:    Pointer to object name, or nil when dirID
  445.                             specifies a directory that's the object.
  446.     theDirID        output:    If the object is a file, then its parent directory
  447.                             ID. If the object is a directory, then its ID.
  448.     isDirectory        output:    True if object is a directory; false if
  449.                             object is a file.
  450. */
  451.  
  452. /*****************************************************************************/
  453.  
  454. pascal    OSErr    DirIDFromFSSpec(const FSSpec *spec,
  455.                                 long *dirID,
  456.                                 Boolean *isDirectory);
  457. /*    ¶ Get the directory ID number of a directory.
  458.     The DirIDFromFSSpec function gets the directory ID number of the
  459.     directory specified by spec. If spec is to a file, then the parent
  460.     directory of the file is returned and isDirectory is false.  If
  461.     spec is to a directory, then that directory's ID number is
  462.     returned and isDirectory is true.
  463.     
  464.     spec            input:    An FSSpec record specifying the directory.
  465.     theDirID        output:    The directory ID.
  466.     isDirectory        output:    True if object is a directory; false if
  467.                             object is a file.
  468. */
  469.  
  470. /*****************************************************************************/
  471.  
  472. pascal    OSErr    GetDirName(short vRefNum,
  473.                            long dirID,
  474.                            StringPtr name);
  475. /*    ¶ Get the name of a directory from its directory ID.
  476.     The GetDirName function gets the name of a directory from its
  477.     directory ID.
  478.  
  479.     vRefNum        input:    Volume specification.
  480.     dirID        input:    Directory ID.
  481.     name        output:    Points to a buffer (minimum Str63) where the
  482.                         directory name is to be returned or must be nil.
  483. */
  484.  
  485. /*****************************************************************************/
  486.  
  487. pascal    OSErr    GetParentID(short vRefNum,
  488.                             long dirID,
  489.                             StringPtr name,
  490.                             long *parID);
  491. /*    ¶ Get the parent directory ID number of the specified object.
  492.     The GetParentID function gets the parent directory ID number of the
  493.     specified object.
  494.     
  495.     vRefNum        input:    Volume specification.
  496.     dirID        input:    Directory ID.
  497.     name        input:    Pointer to object name, or nil when dirID specifies
  498.                         a directory that's the object.
  499.     parID        output:    The parent directory ID of the specified object.
  500. */
  501.  
  502. /*****************************************************************************/
  503.  
  504. pascal    OSErr    GetFilenameFromPathname(ConstStr255Param pathname,
  505.                                         Str255 filename);
  506. /*    ¶ Get the object name from the end of a full or partial pathname.
  507.     The GetFilenameFromPathname function gets the file (or directory) name
  508.     from the end of a full or partial pathname. Returns notAFileErr if the
  509.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  510.     a filename (with a noErr result, the pathname could still refer to a
  511.     directory).
  512.     
  513.     pathname    input:    A full or partial pathname.
  514.     filename    output:    The file (or directory) name.
  515.  
  516.     __________
  517.     
  518.     See also:    GetObjectLocation.
  519. */
  520.  
  521. /*****************************************************************************/
  522.  
  523. pascal    OSErr    GetObjectLocation(short vRefNum,
  524.                                   long dirID,
  525.                                   StringPtr pathname,
  526.                                   short *realVRefNum,
  527.                                   long *realParID,
  528.                                   Str255 realName,
  529.                                   Boolean *isDirectory);
  530. /*    ¶ Get a file system object's location.
  531.     The GetObjectLocation function gets a file system object's location -
  532.     that is, its real volume reference number, real parent directory ID,
  533.     and name. While we're at it, determine if the object is a file or directory.
  534.     If GetObjectLocation returns fnfErr, then the location information
  535.     returned is valid, but it describes an object that doesn't exist.
  536.     You can use the location information for another operation, such as
  537.     creating a file or directory.
  538.     
  539.     vRefNum        input:    Volume specification.
  540.     dirID        input:    Directory ID.
  541.     pathname    input:    Pointer to object name, or nil when dirID specifies
  542.                         a directory that's the object.
  543.     realVRefNum    output:    The real volume reference number.
  544.     realParID    output:    The parent directory ID of the specified object.
  545.     realName    output:    The name of the specified object (the case of the
  546.                         object name may not be the same as the object's
  547.                         catalog entry on disk - since the Macintosh file
  548.                         system is not case sensitive, it shouldn't matter).
  549.     isDirectory    output:    True if object is a directory; false if object
  550.                         is a file.
  551.  
  552.     __________
  553.     
  554.     See also:    FSMakeFSSpecCompat
  555. */
  556.  
  557. /*****************************************************************************/
  558.  
  559. pascal    OSErr    GetDirItems(short vRefNum,
  560.                             long dirID,
  561.                             StringPtr name,
  562.                             Boolean getFiles,
  563.                             Boolean getDirectories,
  564.                             FSSpecPtr items,
  565.                             short reqItemCount,
  566.                             short *actItemCount,
  567.                             short *itemIndex);
  568. /*    ¶ Return a list of items in a directory.
  569.     The GetDirItems function returns a list of items in the specified
  570.     directory in an array of FSSpec records. File, subdirectories, or
  571.     both can be returned in the list.
  572.  
  573.     vRefNum            input:    Volume specification.
  574.     dirID            input:    Directory ID.
  575.     name            input:    Pointer to object name, or nil when dirID
  576.                             specifies a directory that's the object.
  577.     getFiles        input:    Pass true to have files added to the items list.
  578.     getDirectories    input:    Pass true to have directories added to the
  579.                             items list.
  580.     items            input:    Pointer to array of FSSpec where the item list
  581.                             is returned.
  582.     reqItemCount    input:    Maximum number of items to return (the number
  583.                             of elements in the items array).
  584.     actItemCount    output: The number of items actually returned.
  585.     itemIndex        input:    The current item index position. Set to 1 to
  586.                             start with the first item in the directory.
  587.                     output:    The item index position to get the next item.
  588.                             Pass this value the next time you call
  589.                             GetDirItems to start where you left off.
  590. */
  591.  
  592. /*****************************************************************************/
  593.  
  594. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  595.                                          long dirID,
  596.                                         StringPtr name);
  597. /*    ¶ Delete the contents of a directory.
  598.     The DeleteDirectoryContents function deletes the contents of a directory.
  599.     All files and subdirectories in the specified directory are deleted.
  600.     If a locked file or directory is encountered, it is unlocked and then
  601.     deleted.  If any unexpected errors are encountered,
  602.     DeleteDirectoryContents quits and returns to the caller.
  603.     
  604.     vRefNum    input:    Volume specification.
  605.     dirID    input:    Directory ID.
  606.     name    input:    Pointer to directory name, or nil when dirID specifies
  607.                     a directory that's the object.
  608.  
  609.     __________
  610.     
  611.     Also see:    DeleteDirectory
  612. */
  613.  
  614. /*****************************************************************************/
  615.  
  616. pascal    OSErr    DeleteDirectory(short vRefNum,
  617.                                 long dirID,
  618.                                 StringPtr name);
  619. /*    ¶ Delete a directory and its contents.
  620.     The DeleteDirectory function deletes a directory and its contents.
  621.     All files and subdirectories in the specified directory are deleted.
  622.     If a locked file or directory is encountered, it is unlocked and then
  623.     deleted.  After deleting the directories contents, the directory is
  624.     deleted. If any unexpected errors are encountered, DeleteDirectory
  625.     quits and returns to the caller.
  626.     
  627.     vRefNum    input:    Volume specification.
  628.     dirID    input:    Directory ID.
  629.     name    input:    Pointer to directory name, or nil when dirID specifies
  630.                     a directory that's the object.
  631.  
  632.     __________
  633.     
  634.     Also see:    DeleteDirectoryContents
  635. */
  636.  
  637. /*****************************************************************************/
  638.  
  639. pascal    OSErr    CheckObjectLock(short vRefNum,
  640.                                 long dirID,
  641.                                 StringPtr name);
  642. /*    ¶ Determine if a file or directory is locked.
  643.     The CheckObjectLock function determines if a file or directory is locked.
  644.     If CheckObjectLock returns noErr, then the file or directory
  645.     is not locked.
  646.     
  647.     vRefNum    input:    Volume specification.
  648.     dirID    input:    Directory ID.
  649.     name    input:    Pointer to object name, or nil when dirID specifies
  650.                     a directory that's the object.
  651.  
  652.     __________
  653.     
  654.     Also see:    FSpCheckObjectLock
  655. */
  656.  
  657. /*****************************************************************************/
  658.  
  659. pascal    OSErr    FSpCheckObjectLock(const FSSpec *spec);
  660. /*    ¶ Determine if a file or directory is locked.
  661.     The FSpCheckObjectLock function determines if a file or directory is locked.
  662.     If FSpCheckObjectLock returns noErr, then the file or directory
  663.     is not locked.
  664.     
  665.     spec    input:    An FSSpec record specifying the object.
  666.  
  667.     __________
  668.     
  669.     Also see:    CheckObjectLock
  670. */
  671.  
  672. /*****************************************************************************/
  673.  
  674. pascal    OSErr    GetFileSize(short vRefNum,
  675.                             long dirID,
  676.                             ConstStr255Param fileName,
  677.                             long *dataSize,
  678.                             long *rsrcSize);
  679. /*    ¶ Get the logical sizes of a file's forks.
  680.     The GetFileSize function returns the logical size of a file's
  681.     data and resource fork.
  682.     
  683.     vRefNum        input:    Volume specification.
  684.     dirID        input:    Directory ID.
  685.     name        input:    The name of the file.
  686.     dataSize    output:    The number of bytes in the file's data fork.
  687.     rsrcSize    output:    The number of bytes in the file's resource fork.
  688.  
  689.     __________
  690.     
  691.     See also:    FSpGetFileSize
  692. */
  693.  
  694. /*****************************************************************************/
  695.  
  696. pascal    OSErr    FSpGetFileSize(const FSSpec *spec,
  697.                                long *dataSize,
  698.                                long *rsrcSize);
  699. /*    ¶ Get the logical sizes of a file's forks.
  700.     The FSpGetFileSize function returns the logical size of a file's
  701.     data and resource fork.
  702.     
  703.     spec        input:    An FSSpec record specifying the file.
  704.     dataSize    output:    The number of bytes in the file's data fork.
  705.     rsrcSize    output:    The number of bytes in the file's resource fork.
  706.  
  707.     __________
  708.     
  709.     See also:    GetFileSize
  710. */
  711.  
  712. /*****************************************************************************/
  713.  
  714. pascal    OSErr    BumpDate(short vRefNum,
  715.                          long dirID,
  716.                          StringPtr name);
  717. /*    ¶ Update the modification date of a file or directory.
  718.     The BumpDate function changes the modification date of a file or
  719.     directory to the current date/time.  If the modification date is already
  720.     equal to the current date/time, then add one second to the
  721.     modification date.
  722.     
  723.     vRefNum    input:    Volume specification.
  724.     dirID    input:    Directory ID.
  725.     name    input:    Pointer to object name, or nil when dirID specifies
  726.                     a directory that's the object.
  727.  
  728.     __________
  729.     
  730.     See also:    FSpBumpDate
  731. */
  732.  
  733. /*****************************************************************************/
  734.  
  735. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  736. /*    ¶ Update the modification date of a file or directory.
  737.     The FSpBumpDate function changes the modification date of a file or
  738.     directory to the current date/time.  If the modification date is already
  739.     equal to the current date/time, then add one second to the
  740.     modification date.
  741.     
  742.     spec    input:    An FSSpec record specifying the object.
  743.  
  744.     __________
  745.     
  746.     See also:    BumpDate
  747. */
  748.  
  749. /*****************************************************************************/
  750.  
  751. pascal    OSErr    ChangeCreatorType(short vRefNum,
  752.                                   long dirID,
  753.                                   ConstStr255Param name,
  754.                                   OSType creator,
  755.                                   OSType fileType);
  756. /*    ¶ Change the creator or file type of a file.
  757.     The ChangeCreatorType function changes the creator or file type of a file.
  758.  
  759.     vRefNum        input:    Volume specification.
  760.     dirID        input:    Directory ID.
  761.     name        input:    The name of the file.
  762.     creator        input:    The new creator type or 0x00000000 to leave
  763.                         the creator type alone.
  764.     fileType    input:    The new file type or 0x00000000 to leave the
  765.                         file type alone.
  766.  
  767.     __________
  768.     
  769.     See also:    FSpChangeCreatorType
  770. */
  771.  
  772. /*****************************************************************************/
  773.  
  774. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  775.                                      OSType creator,
  776.                                      OSType fileType);
  777. /*    ¶ Change the creator or file type of a file.
  778.     The FSpChangeCreatorType function changes the creator or file type of a file.
  779.  
  780.     spec        input:    An FSSpec record specifying the file.
  781.     creator        input:    The new creator type or 0x00000000 to leave
  782.                         the creator type alone.
  783.     fileType    input:    The new file type or 0x00000000 to leave the
  784.                         file type alone.
  785.  
  786.     __________
  787.     
  788.     See also:    ChangeCreatorType
  789. */
  790.  
  791. /*****************************************************************************/
  792.  
  793. pascal    OSErr    ChangeFDFlags(short vRefNum,
  794.                               long dirID,
  795.                               StringPtr name,
  796.                               Boolean    setBits,
  797.                               unsigned short flagBits);
  798. /*    ¶ Set or clear Finder Flag bits.
  799.     The ChangeFDFlags function sets or clears Finder Flag bits in the
  800.     fdFlags field of a file or directory's FInfo record.
  801.     
  802.     vRefNum        input:    Volume specification.
  803.     dirID        input:    Directory ID.
  804.     name        input:    Pointer to object name, or nil when dirID specifies
  805.                         a directory that's the object.
  806.     setBits        input:    If true, then set the bits specified in flagBits.
  807.                         If false, then clear the bits specified in flagBits.
  808.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  809.                         bits to set or clear. If a bit in flagBits is set,
  810.                         then the same bit in fdFlags is either set or
  811.                         cleared depending on the state of the setBits
  812.                         parameter.
  813.  
  814.     __________
  815.     
  816.     See also:    FSpChangeFDFlags
  817. */
  818.  
  819. /*****************************************************************************/
  820.  
  821. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  822.                                  Boolean setBits,
  823.                                  unsigned short flagBits);
  824. /*    ¶ Set or clear Finder Flag bits.
  825.     The FSpChangeFDFlags function sets or clears Finder Flag bits in the
  826.     fdFlags field of a file or directory's FInfo record.
  827.     
  828.     spec        input:    An FSSpec record specifying the object.
  829.     setBits        input:    If true, then set the bits specified in flagBits.
  830.                         If false, then clear the bits specified in flagBits.
  831.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  832.                         bits to set or clear. If a bit in flagBits is set,
  833.                         then the same bit in fdFlags is either set or
  834.                         cleared depending on the state of the setBits
  835.                         parameter.
  836.  
  837.     __________
  838.     
  839.     See also:    ChangeFDFlags
  840. */
  841.  
  842. /*****************************************************************************/
  843.  
  844. pascal    OSErr    SetIsInvisible(short vRefNum,
  845.                                long dirID,
  846.                                StringPtr name);
  847. /*    ¶ Set the invisible Finder Flag bit.
  848.     The SetIsInvisible function sets the invisible bit in the fdFlags
  849.     word of the specified file or directory's finder information.
  850.     
  851.     vRefNum    input:    Volume specification.
  852.     dirID    input:    Directory ID.
  853.     name    input:    Pointer to object name, or nil when dirID specifies
  854.                     a directory that's the object.
  855.  
  856.     __________
  857.     
  858.     See also:    FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  859. */
  860.  
  861. /*****************************************************************************/
  862.  
  863. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  864. /*    ¶ Set the invisible Finder Flag bit.
  865.     The FSpSetIsInvisible function sets the invisible bit in the fdFlags
  866.     word of the specified file or directory's finder information.
  867.     
  868.     spec    input:    An FSSpec record specifying the object.
  869.  
  870.     __________
  871.     
  872.     See also:    SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  873. */
  874.  
  875. /*****************************************************************************/
  876.  
  877. pascal    OSErr    ClearIsInvisible(short vRefNum,
  878.                                  long dirID,
  879.                                  StringPtr name);
  880. /*    ¶ Clear the invisible Finder Flag bit.
  881.     The ClearIsInvisible function clears the invisible bit in the fdFlags
  882.     word of the specified file or directory's finder information.
  883.     
  884.     vRefNum    input:    Volume specification.
  885.     dirID    input:    Directory ID.
  886.     name    input:    Pointer to object name, or nil when dirID specifies
  887.                     a directory that's the object.
  888.  
  889.     __________
  890.     
  891.     See also:    SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
  892. */
  893.  
  894. /*****************************************************************************/
  895.  
  896. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  897. /*    ¶ Clear the invisible Finder Flag bit.
  898.     The FSpClearIsInvisible function clears the invisible bit in the fdFlags
  899.     word of the specified file or directory's finder information.
  900.     
  901.     spec    input:    An FSSpec record specifying the object.
  902.  
  903.     __________
  904.     
  905.     See also:    SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
  906. */
  907.  
  908. /*****************************************************************************/
  909.  
  910. pascal    OSErr    SetNameLocked(short vRefNum,
  911.                               long dirID,
  912.                               StringPtr name);
  913. /*    ¶ Set the nameLocked Finder Flag bit.
  914.     The SetNameLocked function sets the nameLocked bit in the fdFlags word
  915.     of the specified file or directory's finder information.
  916.     
  917.     vRefNum    input:    Volume specification.
  918.     dirID    input:    Directory ID.
  919.     name    input:    Pointer to object name, or nil when dirID specifies
  920.                     a directory that's the object.
  921.  
  922.     __________
  923.     
  924.     See also:    FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
  925. */
  926.  
  927. /*****************************************************************************/
  928.  
  929. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  930. /*    ¶ Set the nameLocked Finder Flag bit.
  931.     The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
  932.     of the specified file or directory's finder information.
  933.     
  934.     spec    input:    An FSSpec record specifying the object.
  935.  
  936.     __________
  937.     
  938.     See also:    SetNameLocked, ClearNameLocked, FSpClearNameLocked
  939. */
  940.  
  941. /*****************************************************************************/
  942.  
  943. pascal    OSErr    ClearNameLocked(short vRefNum,
  944.                                 long dirID,
  945.                                 StringPtr name);
  946. /*    ¶ Clear the nameLocked Finder Flag bit.
  947.     The ClearNameLocked function clears the nameLocked bit in the fdFlags
  948.     word of the specified file or directory's finder information.
  949.     
  950.     vRefNum    input:    Volume specification.
  951.     dirID    input:    Directory ID.
  952.     name    input:    Pointer to object name, or nil when dirID specifies
  953.                     a directory that's the object.
  954.  
  955.     __________
  956.     
  957.     See also:    SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
  958. */
  959.  
  960. /*****************************************************************************/
  961.  
  962. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  963. /*    ¶ Clear the nameLocked Finder Flag bit.
  964.     The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
  965.     word of the specified file or directory's finder information.
  966.     
  967.     spec    input:    An FSSpec record specifying the object.
  968.  
  969.     __________
  970.     
  971.     See also:    SetNameLocked, FSpSetNameLocked, ClearNameLocked
  972. */
  973.  
  974. /*****************************************************************************/
  975.  
  976. pascal    OSErr    SetIsStationery(short vRefNum,
  977.                                 long dirID,
  978.                                 ConstStr255Param name);
  979. /*    ¶ Set the isStationery Finder Flag bit.
  980.     The SetIsStationery function sets the isStationery bit in the
  981.     fdFlags word of the specified file or directory's finder information.
  982.     
  983.     vRefNum    input:    Volume specification.
  984.     dirID    input:    Directory ID.
  985.     name    input:    Pointer to object name, or nil when dirID specifies
  986.                     a directory that's the object.
  987.  
  988.     __________
  989.     
  990.     See also:    FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
  991. */
  992.  
  993. /*****************************************************************************/
  994.  
  995. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  996. /*    ¶ Set the isStationery Finder Flag bit.
  997.     The FSpSetIsStationery function sets the isStationery bit in the
  998.     fdFlags word of the specified file or directory's finder information.
  999.     
  1000.     spec    input:    An FSSpec record specifying the object.
  1001.  
  1002.     __________
  1003.     
  1004.     See also:    SetIsStationery, ClearIsStationery, FSpClearIsStationery
  1005. */
  1006.  
  1007. /*****************************************************************************/
  1008.  
  1009. pascal    OSErr    ClearIsStationery(short vRefNum,
  1010.                                   long dirID,
  1011.                                   ConstStr255Param name);
  1012. /*    ¶ Clear the isStationery Finder Flag bit.
  1013.     The ClearIsStationery function clears the isStationery bit in the
  1014.     fdFlags word of the specified file or directory's finder information.
  1015.     
  1016.     vRefNum    input:    Volume specification.
  1017.     dirID    input:    Directory ID.
  1018.     name    input:    Pointer to object name, or nil when dirID specifies
  1019.                     a directory that's the object.
  1020.  
  1021.     __________
  1022.     
  1023.     See also:    SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
  1024. */
  1025.  
  1026. /*****************************************************************************/
  1027.  
  1028. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  1029. /*    ¶ Clear the isStationery Finder Flag bit.
  1030.     The FSpClearIsStationery function clears the isStationery bit in the
  1031.     fdFlags word of the specified file or directory's finder information.
  1032.     
  1033.     spec    input:    An FSSpec record specifying the object.
  1034.  
  1035.     __________
  1036.     
  1037.     See also:    SetIsStationery, FSpSetIsStationery, ClearIsStationery
  1038. */
  1039.  
  1040. /*****************************************************************************/
  1041.  
  1042. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  1043.                                  long dirID,
  1044.                                  StringPtr name);
  1045. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  1046.     The SetHasCustomIcon function sets the hasCustomIcon bit in the
  1047.     fdFlags word of the specified file or directory's finder information.
  1048.     
  1049.     vRefNum    input:    Volume specification.
  1050.     dirID    input:    Directory ID.
  1051.     name    input:    Pointer to object name, or nil when dirID specifies
  1052.                     a directory that's the object.
  1053.  
  1054.     __________
  1055.     
  1056.     See also:    FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  1057. */
  1058.  
  1059. /*****************************************************************************/
  1060.  
  1061. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  1062. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  1063.     The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
  1064.     fdFlags word of the specified file or directory's finder information.
  1065.     
  1066.     spec    input:    An FSSpec record specifying the object.
  1067.  
  1068.     __________
  1069.     
  1070.     See also:    SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  1071. */
  1072.  
  1073. /*****************************************************************************/
  1074.  
  1075. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  1076.                                    long dirID,
  1077.                                    StringPtr name);
  1078. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  1079.     The ClearHasCustomIcon function clears the hasCustomIcon bit in the
  1080.     fdFlags word of the specified file or directory's finder information.
  1081.     
  1082.     vRefNum    input:    Volume specification.
  1083.     dirID    input:    Directory ID.
  1084.     name    input:    Pointer to object name, or nil when dirID specifies
  1085.                     a directory that's the object.
  1086.  
  1087.     __________
  1088.     
  1089.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
  1090. */
  1091.  
  1092. /*****************************************************************************/
  1093.  
  1094. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  1095. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  1096.     The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
  1097.     fdFlags word of the specified file or directory's finder information.
  1098.     
  1099.     spec    input:    An FSSpec record specifying the object.
  1100.  
  1101.     __________
  1102.     
  1103.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
  1104. */
  1105.  
  1106. /*****************************************************************************/
  1107.  
  1108. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  1109.                                    long dirID,
  1110.                                    StringPtr name);
  1111. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  1112.     The ClearHasBeenInited function clears the hasBeenInited bit in the
  1113.     fdFlags word of the specified file or directory's finder information.
  1114.     
  1115.     vRefNum    input:    Volume specification.
  1116.     dirID    input:    Directory ID.
  1117.     name    input:    Pointer to object name, or nil when dirID specifies
  1118.                     a directory that's the object.
  1119.  
  1120.     __________
  1121.     
  1122.     See also:    FSpClearHasBeenInited
  1123. */
  1124.  
  1125. /*****************************************************************************/
  1126.  
  1127. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  1128. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  1129.     The FSpClearHasBeenInited function clears the hasBeenInited bit in the
  1130.     fdFlags word of the specified file or directory's finder information.
  1131.     
  1132.     spec    input:    An FSSpec record specifying the object.
  1133.  
  1134.     __________
  1135.     
  1136.     See also:    ClearHasBeenInited
  1137. */
  1138.  
  1139. /*****************************************************************************/
  1140.  
  1141. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  1142.                                       long srcDirID,
  1143.                                       StringPtr srcName,
  1144.                                       short dstVRefNum,
  1145.                                       long dstDirID,
  1146.                                       StringPtr dstName,
  1147.                                       Boolean copyLockBit);
  1148. /*    ¶ Copy all File Manager attributes from the source to the destination.
  1149.     The CopyFileMgrAttributes function copies all File Manager attributes
  1150.     from the source file or directory to the destination file or directory.
  1151.     If copyLockBit is true, then set the locked state of the destination
  1152.     to match the source.
  1153.  
  1154.     srcVRefNum    input:    Source volume specification.
  1155.     srcDirID    input:    Source directory ID.
  1156.     srcName        input:    Pointer to source object name, or nil when
  1157.                         srcDirID specifies a directory that's the object.
  1158.     dstVRefNum    input:    Destination volume specification.
  1159.     dstDirID    input:    Destination directory ID.
  1160.     dstName        input:    Pointer to destination object name, or nil when
  1161.                         dstDirID specifies a directory that's the object.
  1162.     copyLockBit    input:    If true, set the locked state of the destination
  1163.                         to match the source.
  1164.  
  1165.     __________
  1166.     
  1167.     See also:    FSpCopyFileMgrAttributes
  1168. */
  1169.  
  1170. /*****************************************************************************/
  1171.  
  1172. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  1173.                                          const FSSpec *dstSpec,
  1174.                                          Boolean copyLockBit);
  1175. /*    ¶ Copy all File Manager attributes from the source to the destination.
  1176.     The FSpCopyFileMgrAttributes function copies all File Manager attributes
  1177.     from the source file or directory to the destination file or directory.
  1178.     If copyLockBit is true, then set the locked state of the destination
  1179.     to match the source.
  1180.  
  1181.     srcSpec        input:    An FSSpec record specifying the source object.
  1182.     dstSpec        input:    An FSSpec record specifying the destination object.
  1183.     copyLockBit    input:    If true, set the locked state of the destination
  1184.                         to match the source.
  1185.  
  1186.     __________
  1187.     
  1188.     See also:    CopyFileMgrAttributes
  1189. */
  1190.  
  1191. /*****************************************************************************/
  1192.  
  1193. pascal    OSErr    HOpenAware(short vRefNum,
  1194.                            long dirID,
  1195.                            ConstStr255Param fileName,
  1196.                            short denyModes,
  1197.                            short *refNum);
  1198. /*    ¶ Open the data fork of a file using deny mode permissions.
  1199.     The HOpenAware function opens the data fork of a file using deny mode
  1200.     permissions instead the normal File Manager permissions.  If OpenDeny
  1201.     is not available, then HOpenAware translates the deny modes to the
  1202.     closest File Manager permissions and tries to open the file with
  1203.     OpenDF first, and then Open if OpenDF isn't available. By using
  1204.     HOpenAware with deny mode permissions, a program can be "AppleShare
  1205.     aware" and fall back on the standard File Manager open calls
  1206.     automatically.
  1207.  
  1208.     vRefNum        input:    Volume specification.
  1209.     dirID        input:    Directory ID.
  1210.     fileName    input:    The name of the file.
  1211.     denyModes    input:    The deny modes access under which to open the file.
  1212.     refNum        output:    The file reference number of the opened file.
  1213.  
  1214.     __________
  1215.     
  1216.     See also:    FSpOpenAware, HOpenRFAware, FSpOpenRFAware
  1217. */
  1218.  
  1219. /*****************************************************************************/
  1220.  
  1221. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  1222.                              short denyModes,
  1223.                              short *refNum);
  1224. /*    ¶ Open the data fork of a file using deny mode permissions.
  1225.     The FSpOpenAware function opens the data fork of a file using deny mode
  1226.     permissions instead the normal File Manager permissions.  If OpenDeny
  1227.     is not available, then FSpOpenAware translates the deny modes to the
  1228.     closest File Manager permissions and tries to open the file with
  1229.     OpenDF first, and then Open if OpenDF isn't available. By using
  1230.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  1231.     aware" and fall back on the standard File Manager open calls
  1232.     automatically.
  1233.  
  1234.     spec        input:    An FSSpec record specifying the file.
  1235.     denyModes    input:    The deny modes access under which to open the file.
  1236.     refNum        output:    The file reference number of the opened file.
  1237.  
  1238.     __________
  1239.     
  1240.     See also:    HOpenAware, HOpenRFAware, FSpOpenRFAware
  1241. */
  1242.  
  1243. /*****************************************************************************/
  1244.  
  1245. pascal    OSErr    HOpenRFAware(short vRefNum,
  1246.                              long dirID,
  1247.                              ConstStr255Param fileName,
  1248.                              short denyModes,
  1249.                              short *refNum);
  1250. /*    ¶ Open the resource fork of a file using deny mode permissions.
  1251.     The HOpenRFAware function opens the resource fork of a file using deny
  1252.     mode permissions instead the normal File Manager permissions.  If
  1253.     OpenRFDeny is not available, then HOpenRFAware translates the deny
  1254.     modes to the closest File Manager permissions and tries to open the
  1255.     file with OpenRF. By using HOpenRFAware with deny mode permissions,
  1256.     a program can be "AppleShare aware" and fall back on the standard
  1257.     File Manager open calls automatically.
  1258.  
  1259.     vRefNum        input:    Volume specification.
  1260.     dirID        input:    Directory ID.
  1261.     fileName    input:    The name of the file.
  1262.     denyModes    input:    The deny modes access under which to open the file.
  1263.     refNum        output:    The file reference number of the opened file.
  1264.  
  1265.     __________
  1266.     
  1267.     See also:    HOpenAware, FSpOpenAware, FSpOpenRFAware
  1268. */
  1269.  
  1270. /*****************************************************************************/
  1271.  
  1272. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  1273.                                short denyModes,
  1274.                                short *refNum);
  1275. /*    ¶ Open the resource fork of a file using deny mode permissions.
  1276.     The FSpOpenRFAware function opens the resource fork of a file using deny
  1277.     mode permissions instead the normal File Manager permissions.  If
  1278.     OpenRFDeny is not available, then FSpOpenRFAware translates the deny
  1279.     modes to the closest File Manager permissions and tries to open the
  1280.     file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
  1281.     a program can be "AppleShare aware" and fall back on the standard
  1282.     File Manager open calls automatically.
  1283.  
  1284.     spec        input:    An FSSpec record specifying the file.
  1285.     denyModes    input:    The deny modes access under which to open the file.
  1286.     refNum        output:    The file reference number of the opened file.
  1287.  
  1288.     __________
  1289.     
  1290.     See also:    HOpenAware, FSpOpenAware, HOpenRFAware
  1291. */
  1292.  
  1293. /*****************************************************************************/
  1294.  
  1295. pascal    OSErr    FSReadNoCache(short refNum,
  1296.                               long *count,
  1297.                               void *buffPtr);
  1298. /*    ¶ Read any number of bytes from an open file requesting no caching.
  1299.     The FSReadNoCache function reads any number of bytes from an open file
  1300.     while asking the file system to bypass its cache mechanism.
  1301.     
  1302.     refNum    input:    The file reference number of an open file.
  1303.     count    input:    The number of bytes to read.
  1304.             output:    The number of bytes actually read.
  1305.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  1306.                     to be read.
  1307.  
  1308.     __________
  1309.     
  1310.     See also:    FSWriteNoCache
  1311. */
  1312.  
  1313. /*****************************************************************************/
  1314.  
  1315. pascal    OSErr    FSWriteNoCache(short refNum,
  1316.                                long *count,
  1317.                                const void *buffPtr);
  1318. /*    ¶ Write any number of bytes to an open file requesting no caching.
  1319.     The FSReadNoCache function writes any number of bytes to an open file
  1320.     while asking the file system to bypass its cache mechanism.
  1321.     
  1322.     refNum    input:    The file reference number of an open file.
  1323.     count    input:    The number of bytes to write to the file.
  1324.             output:    The number of bytes actually written.
  1325.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  1326.                     to be written.
  1327.  
  1328.     __________
  1329.     
  1330.     See also:    FSReadNoCache
  1331. */
  1332.  
  1333. /*****************************************************************************/
  1334.  
  1335. pascal    OSErr    FSWriteVerify(short refNum,
  1336.                               long *count,
  1337.                               const void *buffPtr);
  1338. /*    ¶ Write any number of bytes to an open file and then verify the data was written.
  1339.     The FSWriteVerify function writes any number of bytes to an open file
  1340.     and then verifies that the data was actually written to the device.
  1341.     
  1342.     refNum    input:    The file reference number of an open file.
  1343.     count    input:    The number of bytes to write to the file.
  1344.             output:    The number of bytes actually written and verified.
  1345.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  1346.                     to be written.
  1347. */
  1348.  
  1349. /*****************************************************************************/
  1350.  
  1351. pascal    OSErr    CopyFork(short srcRefNum,
  1352.                          short dstRefNum,
  1353.                          void *copyBufferPtr,
  1354.                          long copyBufferSize);
  1355. /*    ¶ Copy all data from the source fork to the destination fork of open file forks.
  1356.     The CopyFork function copies all data from the source fork to the
  1357.     destination fork of open file forks and makes sure the destination EOF
  1358.     is equal to the source EOF.
  1359.     
  1360.     srcRefNum        input:    The source file reference number.
  1361.     dstRefNum        input:    The destination file reference number.
  1362.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  1363.                             buffer should be at least 512-bytes minimum.
  1364.                             The larger the buffer, the faster the copy.
  1365.     copyBufferSize    input:    The size of the copy buffer.
  1366. */
  1367.  
  1368. /*****************************************************************************/
  1369.  
  1370. pascal    OSErr    GetFileLocation(short refNum,
  1371.                                 short *vRefNum,
  1372.                                 long *dirID,
  1373.                                 StringPtr fileName);
  1374. /*    ¶ Get the location of an open file.
  1375.     The GetFileLocation function gets the location (volume reference number,
  1376.     directory ID, and fileName) of an open file.
  1377.  
  1378.     refNum        input:    The file reference number of an open file.
  1379.     vRefNum        output:    The volume reference number.
  1380.     dirID        output:    The parent directory ID.
  1381.     fileName    input:    Points to a buffer (minimum Str63) where the
  1382.                         filename is to be returned or must be nil.
  1383.                 output:    The filename.
  1384.  
  1385.     __________
  1386.     
  1387.     See also:    FSpGetFileLocation
  1388. */
  1389.  
  1390. /*****************************************************************************/
  1391.  
  1392. pascal    OSErr    FSpGetFileLocation(short refNum,
  1393.                                    FSSpec *spec);
  1394. /*    ¶ Get the location of an open file in an FSSpec record.
  1395.     The FSpGetFileLocation function gets the location of an open file in
  1396.     an FSSpec record.
  1397.  
  1398.     refNum        input:    The file reference number of an open file.
  1399.     spec        output:    FSSpec record containing the file name and location.
  1400.  
  1401.     __________
  1402.     
  1403.     See also:    GetFileLocation
  1404. */
  1405.  
  1406. /*****************************************************************************/
  1407.  
  1408. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  1409.                                     long srcDirID,
  1410.                                     StringPtr srcName,
  1411.                                     short dstVRefNum,
  1412.                                     long dstDirID,
  1413.                                     StringPtr dstName);
  1414. /*    ¶ Copy the AFP directory access privileges.
  1415.     The CopyDirectoryAccess function copies the AFP directory access
  1416.     privileges from one directory to another. Both directories must be on
  1417.     the same file server, but not necessarily on the same server volume.
  1418.     
  1419.     srcVRefNum    input:    Source volume specification.
  1420.     srcDirID    input:    Source directory ID.
  1421.     srcName        input:    Pointer to source directory name, or nil when
  1422.                         srcDirID specifies the directory.
  1423.     dstVRefNum    input:    Destination volume specification.
  1424.     dstDirID    input:    Destination directory ID.
  1425.     dstName        input:    Pointer to destination directory name, or nil when
  1426.                         dstDirID specifies the directory.
  1427.  
  1428.     __________
  1429.     
  1430.     See also:    FSpCopyDirectoryAccess
  1431. */
  1432.  
  1433. /*****************************************************************************/
  1434.  
  1435. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  1436.                                        const FSSpec *dstSpec);
  1437. /*    ¶ Copy the AFP directory access privileges.
  1438.     The FSpCopyDirectoryAccess function copies the AFP directory access
  1439.     privileges from one directory to another. Both directories must be on
  1440.     the same file server, but not necessarily on the same server volume.
  1441.  
  1442.     srcSpec        input:    An FSSpec record specifying the source directory.
  1443.     dstSpec        input:    An FSSpec record specifying the destination directory.
  1444.  
  1445.     __________
  1446.     
  1447.     See also:    CopyDirectoryAccess
  1448. */
  1449.  
  1450. /*****************************************************************************/
  1451.  
  1452. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  1453.                                   long srcDirID,
  1454.                                   ConstStr255Param srcName,
  1455.                                   long dstDirID,
  1456.                                   StringPtr dstpathName,
  1457.                                   StringPtr copyName);
  1458. /*    ¶ Move a file or directory and optionally rename it.
  1459.     The HMoveRenameCompat function moves a file or directory and optionally
  1460.     renames it.  The source and destination locations must be on the same
  1461.     volume. This routine works even if the volume doesn't support MoveRename.
  1462.     
  1463.     vRefNum        input:    Volume specification.
  1464.     srcDirID    input:    Source directory ID.
  1465.     srcName        input:    The source object name.
  1466.     dstDirID    input:    Destination directory ID.
  1467.     dstName        input:    Pointer to destination directory name, or
  1468.                         nil when dstDirID specifies a directory.
  1469.     copyName    input:    Points to the new name if the object is to be
  1470.                         renamed or nil if the object isn't to be renamed.
  1471.  
  1472.     __________
  1473.     
  1474.     See also:    FSpMoveRenameCompat
  1475. */
  1476.  
  1477. /*****************************************************************************/
  1478.  
  1479. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  1480.                                     const FSSpec *dstSpec,
  1481.                                     StringPtr copyName);
  1482. /*    ¶ Move a file or directory and optionally rename it.
  1483.     The FSpMoveRenameCompat function moves a file or directory and optionally
  1484.     renames it.  The source and destination locations must be on the same
  1485.     volume. This routine works even if the volume doesn't support MoveRename.
  1486.     
  1487.     srcSpec        input:    An FSSpec record specifying the source object.
  1488.     dstSpec        input:    An FSSpec record specifying the destination
  1489.                         directory.
  1490.     copyName    input:    Points to the new name if the object is to be
  1491.                         renamed or nil if the object isn't to be renamed.
  1492.  
  1493.     __________
  1494.     
  1495.     See also:    HMoveRenameCompat
  1496. */
  1497.  
  1498. /*****************************************************************************/
  1499.  
  1500. pascal    void    BuildAFPVolMountInfo(short theFlags,
  1501.                                      char theNBPInterval,
  1502.                                      char theNBPCount,
  1503.                                      short theUAMType,
  1504.                                      Str31 theZoneName,
  1505.                                      Str31 theServerName,
  1506.                                      Str27 theVolName,
  1507.                                      Str31 theUserName,
  1508.                                      Str8 theUserPassWord,
  1509.                                      Str8 theVolPassWord,
  1510.                                      MyAFPVolMountInfoPtr theAFPInfo);
  1511. /*    ¶ Initialize the fields of an AFPVolMountInfo record.
  1512.     The BuildAFPVolMountInfo function initializes the fields of an
  1513.     AFPVolMountInfo record for use before using that record to call
  1514.     the VolumeMount function.
  1515.     
  1516.     theFlags        input:    The AFP mounting flags. 0 = normal mount;
  1517.                             set bit 0 to inhibit greeting messages.
  1518.     theNBPInterval    input:    The interval used for VolumeMount's
  1519.                             NBP Lookup call. 7 is a good choice.
  1520.     theNBPCount        input:    The retry count used for VolumeMount's
  1521.                             NBP Lookup call. 5 is a good choice.
  1522.     theUAMType        input:    The user authentication method to use.
  1523.     theZoneName        input:    The AppleTalk zone name of the server.
  1524.     theServerName    input:    The AFP server name.
  1525.     theVolName        input:    The AFP volume name.
  1526.     theUserName        input:    The user name (zero length Pascal string for
  1527.                             guest).
  1528.     theUserPassWord    input:    The user password (zero length Pascal string
  1529.                             if no user password)
  1530.     theVolPassWord    input:    The volume password (zero length Pascal string
  1531.                             if no volume password)
  1532.     theAFPInfo        input:    Pointer to AFPVolMountInfo record to
  1533.                             initialize.
  1534.  
  1535.     __________
  1536.     
  1537.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  1538.                 RetrieveAFPVolMountInfo
  1539. */
  1540.  
  1541. /*****************************************************************************/
  1542.  
  1543. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr theAFPInfo,
  1544.                                         short *theFlags,
  1545.                                         short *theUAMType,
  1546.                                         StringPtr theZoneName,
  1547.                                         StringPtr theServerName,
  1548.                                         StringPtr theVolName,
  1549.                                         StringPtr theUserName);
  1550. /*    ¶ Retrieve the AFP mounting information from an AFPVolMountInfo record.
  1551.     The RetrieveAFPVolMountInfo function retrieves the AFP mounting
  1552.     information returned in an AFPVolMountInfo record by the
  1553.     GetVolMountInfo function.
  1554.     
  1555.     theAFPInfo        input:    Pointer to AFPVolMountInfo record that contains
  1556.                             the AFP mounting information.
  1557.     theFlags        output:    The AFP mounting flags. 0 = normal mount;
  1558.                             if bit 0 is set, greeting meesages were inhibited.
  1559.     theUAMType        output:    The user authentication method used.
  1560.     theZoneName        output:    The AppleTalk zone name of the server.
  1561.     theServerName    output:    The AFP server name.
  1562.     theVolName        output:    The AFP volume name.
  1563.     theUserName        output:    The user name (zero length Pascal string for
  1564.                             guest).
  1565.  
  1566.     __________
  1567.     
  1568.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  1569.                 BuildAFPVolMountInfo
  1570. */
  1571.  
  1572. /*****************************************************************************/
  1573.  
  1574. pascal    OSErr    GetUGEntries(short objType,
  1575.                              UGEntryPtr entries,
  1576.                              long reqEntryCount,
  1577.                              long *actEntryCount,
  1578.                              long *objID);
  1579. /*    ¶ Retrieve a list of user or group entries from the local file server.
  1580.     The GetUGEntries functions retrieves a list of user or group entries
  1581.     fromthe local file server.
  1582.  
  1583.     objType            input:    The object type: -1 = group; 0 = user
  1584.     UGEntries        input:    Pointer to array of UGEntry records where the list
  1585.                             is returned.
  1586.     reqEntryCount    input:    The number of elements in the UGEntries array.
  1587.     actEntryCount    output:    The number of entries returned.
  1588.     objID            input:    The current index position. Set to 0 to start with
  1589.                             the first entry.
  1590.                     output:    The index position to get the next entry. Pass this
  1591.                             value the next time you call GetUGEntries to start
  1592.                             where you left off.
  1593.  
  1594.     __________
  1595.     
  1596.     Also see:    GetUGEntry
  1597. */
  1598.  
  1599. /*****************************************************************************/
  1600.  
  1601. #endif    /* __MOREFILESEXTRAS__ */